<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to MEF</title>
<link href="view/css/mefstylesheet.css" type="text/css" rel="stylesheet"/>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('a.login-window').click(function() {
		
                //Getting the variable's value from a link 
		var loginBox = $(this).attr('href');

		//Fade in the Popup
		$(loginBox).fadeIn(300);
		
		//Set the center alignment padding + border see css style
		var popMargTop = ($(loginBox).height() + 24) / 2; 
		var popMargLeft = ($(loginBox).width() + 24) / 2; 
		
		$(loginBox).css({ 
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
		
		// Add the mask to body
		$('body').append('<div id="mask"></div>');
		$('#mask').fadeIn(300);
		
		return false;
	});
	
	// When clicking on the button close or the mask layer the popup closed
	$('a.close, #mask').live('click', function() { 
	  $('#mask , .login-popup').fadeOut(300 , function() {
		$('#mask').remove();  
	}); 
	return false;
	});
});
</script>
<style type="text/css">
/* Mask for background, by default is not display */
.tabcnt{ float:left !important;}
#mask {
	display: none;
	background: #000; 
	position: fixed; left: 0; top: 0; 
	z-index: 10;
	width: 100%; height: 100%;
	opacity: 0.8;
	z-index: 999;
}

/* You can customize to your needs  */
.login-popup{
	display:none;
	background:#fff;
	padding: 10px; 	
	border: 2px solid #ddd;
	float: left;
	font-size: 1.2em;
	position: fixed;
	top: 50%; left: 50%;
	z-index: 99999;
	border:5px solid #ccc;
	border-radius:3px 3px 3px 3px;
	-moz-border-radius: 3px; /* Firefox */
	-webkit-border-radius: 3px; /* Safari, Chrome */
	width:450px; height:260px;
}

img.btn_close { 
	float: right; 
	
}

fieldset { 
	border:none; 
}

form.signin .textbox label { 
	display:block; 
	padding-bottom:7px; 
}

form.signin .textbox span { 
	display:block;
	float:left;
	width:130px;
}

form.signin p, form.signin span { 

	color: #333;
font-size: 15px;
line-height: 26px;
padding-left: 10px;
margin-top: 3px;
} 

form.signin .textbox input { 
 
	border:1px solid #ccc;
	margin-top:5px;
	height:18px;
	color:#333; 
        border-radius: 3px 3px 3px 3px;
	-moz-border-radius: 3px;
        -webkit-border-radius: 3px;
	font:13px Arial, Helvetica, sans-serif;
	padding:6px 6px 8px 6px;
	width:200px;
	margin-left:10px;
	line-height:18px;
	
}

form.signin input:-moz-placeholder { color:#333;  }
form.signin input::-webkit-input-placeholder { color:#333;  }

.button { 
	background: -moz-linear-gradient(center top, #f3f3f3, #dddddd);
	background: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#dddddd));
	background:  -o-linear-gradient(top, #f3f3f3, #dddddd);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f3f3f3', EndColorStr='#dddddd');
	border-color:#000; 
	border-width:1px;
        border-radius:4px 4px 4px 4px;
	-moz-border-radius: 4px;
        -webkit-border-radius: 4px;
	color:#333;
	cursor:pointer;
	display:inline-block;
	
	margin-top:10px;
	font:12px; 
	width:105px;
	height: 35px;
margin-left: 148px !important;
float: left;
}
.button:hover { background:#ddd; }

</style>
<script>
  $(function() {
    $( "#tabs" ).tabs();
  });
  </script>
 <script>
 $(function() {
$( "#datepicker" ).datepicker({
onSelect: function(dateText) {
	var date1 = new Date();
	var date2 = new Date(dateText);
	var y1 = date1.getFullYear(); //getting current year
	var y2 = date2.getFullYear(); //getting dob year
	var age = y1 - y2;           //calculating age
	$("#age").val(age);return true;
},
yearRange: '1900:9999',
changeMonth: true,
changeYear: true
});
});
 $(function() {
$( "#datepicker1" ).datepicker({
yearRange: '1900:9999',
changeMonth: true,
changeYear: true
});
});
</script>
<script>
function validate()
{
	if(document.form.uname.value==""){
				alert("please enter name");
				document.form.uname.focus();
				return false;
			}
	if(document.form.fname.value==""){
				alert("please enter father's name");
				document.form.fname.focus();
				return false;
			}
	if(document.form.mobile.value==""){
				alert("please enter mobile");
				document.form.mobile.focus();
				return false;
			}
	if(document.form.city.value==""){
				alert("please enter city");
				document.form.city.focus();
				return false;
	}
	if(document.form.req.value==""){
				alert("please enter Referes Name");
				document.form.req.focus();
				return false;
	}
	document.form.submit();
	
}
</script>

</head>
<?php echo $header; ?>
<div class="mef_mainbody">
<div class="mef_container">
<div class="meffullpart">
<div class="afbf_wp">
<!--<a href="#"><input type="button" value="Before" class="bfrbtn"/></a>&nbsp;&nbsp;<a href="#"><input type="button" value="After" class="afrbtn"/></a>&nbsp;&nbsp;<a href="#"><input type="button" value="Save" class="savebtn"/></a>&nbsp;&nbsp;<a href="#"><input type="button" value="Edit" class="editbtn"/></a>-->
</div>
<div id="tabs" class="checkregpart">
  <!--<ul>
    <li><a href="#tabs-4">User Registration</a></li>
    <li><a href="#tabs-1">Environmental</a></li>
    <li><a href="#tabs-2">Planetary Positions</a></li>
    <li><a href="#tabs-3">Chakras</a></li>
  </ul>-->
		<div class="tabcnt checkregcnt">
 <div id="tabs-4">

<div class="user_registration">
<form id=form name=form method="post" action="" onsubmit="return validate();" enctype="multipart/form-data">
    <p style="line-height:42px; font-size:18px;font-weight:normal;"><b>User Registration</b></p>
        <?php if(isset($userdetailes['image'])) {  ?>
		<img src="../image/userimages/<? echo $userdetailes['image'];?>" width="150" height="150"/><br/><br/>Upload Photo<input type="file" class="tex" name="file"/><dr/><? } else {?>
		<label class="label">Upload Photo</label>
			<input type="file" class="tex" name="file"/><? } ?>
			<input type="hidden" name="image" id="image" value="<? echo $userdetailes['image'];?>"/>
			<br><br/>
        <label class="label"><span class="required">*</span>Name </label>
			<input type="text" class="tex" name="uname" value="<?php if(isset($userdetailes['name'])) { echo $userdetailes['name']; }?>">
			<br>
        <label class="label"><span class="required">*</span>Father's Name</label>
			<input type="text" class="tex" name="fname" value="<?php if(isset($userdetailes['fathername'])) {echo $userdetailes['fathername']; }?>">
			<br>
        <label class="label">Date of Birth or Age</label>
			<input type="text" id="datepicker" name="datepicker" value="<?php if(isset($userdetailes['dob'])) {echo $userdetailes['dob']; }?>"/>&nbsp;or&nbsp;<?php if($userdetailes['age']!='0') {?><input type="text" class="agebox"  style="width:30px" name="age" id="age" value="<?php echo $userdetailes['age'];?>"><?}else{?><input type="text" class="agebox"  style="width:30px" name="age" id="age" ><?}?>
			<br>
        <label class="label"><span class="required">*</span>Mobile</label>
			<input type="text" class="tex" name="mobile" value="<?php if(isset($userdetailes['mobile'])) {echo $userdetailes['mobile']; }?>">
			<br>
        <label class="label">Phone Number </label>
			<input type="text" class="tex2" name="phone" value="<?php if(isset($userdetailes['phonenumber'])) {echo $userdetailes['phonenumber']; }?>">
			<br>
        <label class="label">E-mail ID </label>
			<input type="text" class="tex2" name="email" value="<?php if(isset($userdetailes['email'])) {echo $userdetailes['email']; }?>">
			<br>
        <label class="label">Address</label>
			<textarea name="address" class="tex" id="address"><?php if(isset($userdetailes['address'])) {echo $userdetailes['address']; }?></textarea>
			<br>
        <label class="label"><span class="required">*</span>City</label>
			<input type="text" class="tex2" name="city" value="<?php if(isset($userdetailes['city'])) {echo $userdetailes['city']; }?>">
			<br>
        <label class="label">District</label>
			<input type="text" class="tex2" name="dist" value="<?php if(isset($userdetailes['district'])) {echo $userdetailes['district']; }?>">
			<br>
        <label class="label">Pincode</label>
			<input type="text" class="tex2" name="pin" value="<?php if(isset($userdetailes['pincode'])) {echo $userdetailes['pincode']; }?>">
			<br>
		
		<label class="label">Country</label>
			<select id="countries" name="countries">
				<option>--Select Country--</option>
					<?php foreach($country as $countrydetails){
						if ($countrydetails['name']== trim($userdetailes['country'])) { ?>
							<option value="<?php  echo $countrydetails['name'];?>" selected="selected"><?php echo $countrydetails['name'];  ?></option>
						<? } else { ?>
							<option value="<?php  echo $countrydetails['name']; ?> "><?php echo $countrydetails['name'];  ?></option>				
						<?php }?>
					<?php }?>
			</select>
			<br/>
			<label class="label" >State</label>
			<select name="state" id="state" >
				<option>--Select State--</option>
					<?php 
						//echo '<pre>';print_r($state);exit;
						foreach($state as $statedetails){ ?>
							<?php if ($statedetails['name']==trim($userdetailes['state'])) { ?>
								<option value="<?php echo $statedetails['name'];?>" selected="selected" ><?php echo $statedetails['name'];  ?></option>		
							<? } else { ?>
								<option value="<?php echo $statedetails['name'];?>"><?php echo $statedetails['name'];  ?></option>		
							<?php }?>
						<?php }?>
			</select>
			<br>
		<label class="label"><span class="required">*</span>Referred by </label>
			<input type="text" class="tex2" name="req" value="<?php if(isset($userdetailes['refereed'])) { echo $userdetailes['refereed']; }?>">
			<br/>
		<label class="label">Date of Visit</label>
			<input type="text" class="tex2" id="datepicker1" name="datepicker1" value="<?php if(isset($userdetailes['dateofvisit'])) {echo $userdetailes['dateofvisit'];}?>"  />
			<br/>
		<label class="label">Already Visit Or Not</label><br/>&nbsp;&nbsp;
		<?php if($userdetailes['p_exit_or_not']=="Yes") { ?>
			<input type="radio" name="opt" id="opt"  value="Yes" checked="checked" >Yes
		<?} else{ ?>
		<input type="radio" name="opt" id="opt"  value="Yes" >Yes
		<?}if($userdetailes['p_exit_or_not']=="No"){?>
			<input type="radio" name="opt" id="opt"  value="No" checked="checked" >No
		<?} else{ ?>
			<input type="radio" name="opt" id="opt"  value="No" >No
		<?}?>
			<br/><br/>
		<input type="hidden" name="hidUid" id="hidUid" value="<?php echo $uid;?>">
		<input type="submit" name="savbtn" id="savbtn" class="reg_sbbtn" value="Save"/><a href="<?php echo $cancelUrl; ?>"><input type="button" name="cancelbtn" id="cancelbtn" class="reg_sbbtn" value="Cancel"/></a>
		<br/><br/>
</form>
          </div>

</div>


<br/><br/>

</div>

</div>
</div>
</div>
<?php echo $footer;?>
</body>
</html>
<script type="text/javascript">

$('select[name=\'countries\']').bind('change', function() {
	$.ajax({
		url: 'index.php?route=common/country&country_id=' + this.value + "&token=<?=$token?>",
		dataType: 'json',
		beforeSend: function() {
			$('select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
		},
		complete: function() {
			$('.wait').remove();
		},			
		success: function(json) {
			if (json['postcode_required'] == '1') {
				$('#postcode-required').show();
			} else {
				$('#postcode-required').hide();
			}
			
			html = '<option value=""> --- Please Select --- </option>';
			
			if (json['zone'] != '') {
				for (i = 0; i < json['zone'].length; i++) {
        			html += '<option value="' + json['zone'][i]['zone_id'] + '"';
	    			
					if (json['zone'][i]['zone_id'] == '') {
	      				html += ' selected="selected"';
	    			}
	
	    			html += '>' + json['zone'][i]['name'] + '</option>';
				}
			} else {
				//html += '<option value="0" selected="selected"> --- None --- </option>';
			}
			
			$('select[name=\'state\']').html(html);
		},
		error: function(xhr, ajaxOptions, thrownError) {
			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
		}
	});
});

$('select[name=\'country_id\']').trigger('change');
</script> 

